package com.agriculture.competition.service.impl;

import java.util.List;
import com.agriculture.common.core.utils.DateUtils;
import com.agriculture.competition.domain.JaCompetitionSolution;
import com.agriculture.competition.mapper.JaCompetitionSolutionMapper;
import com.agriculture.competition.service.IJaCompetitionSolutionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 解决方案Service业务层处理
 * 
 * @author agriculture
 * @date 2024-11-12
 */
@Service
public class JaCompetitionSolutionServiceImpl implements IJaCompetitionSolutionService
{
    @Autowired
    private JaCompetitionSolutionMapper jaCompetitionSolutionMapper;

    /**
     * 查询解决方案
     * 
     * @param id 解决方案主键
     * @return 解决方案
     */
    @Override
    public JaCompetitionSolution selectJaCompetitionSolutionById(Long id)
    {
        return jaCompetitionSolutionMapper.selectJaCompetitionSolutionById(id);
    }

    /**
     * 查询解决方案列表
     * 
     * @param jaCompetitionSolution 解决方案
     * @return 解决方案
     */
    @Override
    public List<JaCompetitionSolution> selectJaCompetitionSolutionList(JaCompetitionSolution jaCompetitionSolution)
    {
        return jaCompetitionSolutionMapper.selectJaCompetitionSolutionList(jaCompetitionSolution);
    }

    /**
     * 新增解决方案
     * 
     * @param jaCompetitionSolution 解决方案
     * @return 结果
     */
    @Override
    public int insertJaCompetitionSolution(JaCompetitionSolution jaCompetitionSolution)
    {
        jaCompetitionSolution.setCreateTime(DateUtils.getNowDate());
        return jaCompetitionSolutionMapper.insertJaCompetitionSolution(jaCompetitionSolution);
    }

    /**
     * 修改解决方案
     * 
     * @param jaCompetitionSolution 解决方案
     * @return 结果
     */
    @Override
    public int updateJaCompetitionSolution(JaCompetitionSolution jaCompetitionSolution)
    {
        jaCompetitionSolution.setUpdateTime(DateUtils.getNowDate());
        return jaCompetitionSolutionMapper.updateJaCompetitionSolution(jaCompetitionSolution);
    }

    /**
     * 批量删除解决方案
     * 
     * @param ids 需要删除的解决方案主键
     * @return 结果
     */
    @Override
    public int deleteJaCompetitionSolutionByIds(Long[] ids)
    {
        return jaCompetitionSolutionMapper.deleteJaCompetitionSolutionByIds(ids);
    }

    /**
     * 删除解决方案信息
     * 
     * @param id 解决方案主键
     * @return 结果
     */
    @Override
    public int deleteJaCompetitionSolutionById(Long id)
    {
        return jaCompetitionSolutionMapper.deleteJaCompetitionSolutionById(id);
    }
}
